package cn.tedu.charging.device.warm;

import cn.tedu.charging.device.service.DeviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class StationWarmUp implements ApplicationRunner {
    @Autowired
    DeviceService deviceService;
    /**
     *bean生命周期
     * 1.实例化对象
     * 2.初始化方法
     * 3。属性 值 注入
     * 4.结束初始化
     * 5。在容器驻留
     */
    @Override
    public void run(ApplicationArguments args) throws Exception {
//        log.debug("缓存场站数据预热开始执行");
//        deviceService.startOnceWarmUp();
       deviceService.startOnceWarmUp();
    }
}
